package com.example.flowermall.controller;

import com.example.flowermall.entity.OrderItem;
import com.example.flowermall.entity.Orders;
import com.example.flowermall.entity.Result;
import com.example.flowermall.service.IOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaoman
 * @since 2023-09-06
 */
@RestController
@RequestMapping("/orderItem")
public class OrderItemController {
    @Autowired
    IOrderItemService orderItemService;
    @GetMapping("/detail")

    //这个方法不能用
    public Result getByOrderId(@RequestParam(value = "orderId")String orderId){
        List<OrderItem> byOrderId = orderItemService.getByOrderId(orderId);
        Result result=Result.success();
        result.put("data", byOrderId);
        return result;
    }
}
